package com.qx.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qx.mapper.SupplierMapper;
import com.qx.po.Supplier;
import com.qx.service.ISupplierService;

@Service("iSupplierService")
public class SuppplierServiceImpl implements ISupplierService{
	 @Autowired
	   private SupplierMapper supplierMapper; //通过@Autowired向spring容器注入EmployeesMapper
	   
	   public void setSupplierMapper(SupplierMapper supplierMapper) {
		   this.supplierMapper = supplierMapper;
	}
	   
	@Override
	public List<Supplier> selectSupplierAll() throws Exception {
		List<Supplier> emp = supplierMapper.selectSupplierAll();
        return emp;
	}
	@Override
	//修改指定供应商的信息。
	public void updateSupplierBysno(Supplier supplier) throws Exception {
		supplierMapper.updateSupplierBysno(supplier);

	}
	@Override  
	//删除指定供应商数据。
	public void deleteSupplierBysno(String sno) throws Exception {
		supplierMapper.deleteSupplierBysno(sno);

	}
	@Override
	//向 Supplier 表插入一条数据
    public void insertSupplier(Supplier supplier) throws Exception {
		supplierMapper.insertSupplier(supplier);

    }
	@Override
	//根据 sno 查询 supplier 表数据
	public Supplier selectSupplierBysno(String sno) throws Exception {
		Supplier emp = supplierMapper.selectSupplierBysno(sno);
        return emp;
	}

}
